import random

secret_num = random.randint(1, 10)
print(secret_num)
max_guesses = 3
for i in range(1, max_guesses+1):
    guess_num = int(input("请输入一个数字， 范围【1-10】"))
    if guess_num > secret_num:
        print("猜大了", max_guesses - i)
    elif guess_num < secret_num:
        print("猜小了", max_guesses - i)
    else:
        print("恭喜你，猜对了，数字正是", guess_num, max_guesses - i)
        break
else:
    print("很遗憾，三次机会已经用完！")